<?php
include("connection/connection.php");
if(isset($_POST['submit']))
{
$sourceId=$_POST['critical_id'];
$critical=$_POST['critical'];


if($critical=="yes")
{
        $CH_quality=$_POST['CH_quality'];

		if(count($CH_quality)!=0)
		{	
			$CH_quality=implode(",",$CH_quality);
		}
		else
		{
			$CH_quality='';
		}
		
		$CH_quantity=$_POST['CH_quantity'];	
		if(count($CH_quantity)!=0)
		{	
			$CH_quantity=implode(",",$CH_quantity);
		}
		else
		{
			$CH_quantity='';
		}
}else{
$CH_quality='';
$CH_quantity='';
}
$qr2="UPDATE tbl_dtls_q1_critical SET critical='$critical', CH_quality='$CH_quality', CH_quantity='$CH_quantity' WHERE id='$sourceId'";		
		//echo $qr2;
		
$rec2=mysql_query($qr2);
if($rec2)
{
header("location:q1_rwss_edit.php");
}
}		
?>